#include "Command.h"

#include <iostream>
using namespace std;

Command::Command(Type type) :
    mType(type)
{}

Command::Command(const Command &other) :
    mType(other.mType),
    mArgs(other.mArgs)
{}

void Command::setArgs(int capacity, const QVariant *arg, ...)
{
    const QVariant **args = &arg;
    mArgs.clear();
    while ( capacity-- )
    {
        mArgs.append(**args++);
        std::cerr << "appeded arg: " << mArgs[mArgs.count() - 1].toString().toStdString() << endl;
    }
}

const QVector<QVariant>& Command::args() const
{
    return mArgs;
}

Command::Type Command::type() const
{
    return mType;
}
